package com.cskaoyan.javase._0encapsulate._1notice;

/**
 * 对于boolean类型的成员变量来说，Getter方法的名字比较特殊
 *      采用isXxx（Xxx是变量名）的形式。
 * 如果成员变量本身就叫做"isXxx",那么就会导致Getter方法的名字出现问题
 * 所以不推荐采取这种方式
 *
 * @since 16:06
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
}

class Student {
    private static int num = 666;
    private String gender;
    // 不推荐
    private boolean isMale;
    private boolean flag;

    public static int getNum() {
        return num;
    }

    public static void setNum(int num) {
        Student.num = num;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public boolean isMale() {
        return isMale;
    }

    public void setMale(boolean male) {
        isMale = male;
    }
}